import static org.junit.Assert.*;
import org.junit.Test;

public class ExerciseTest {
    @Test
    public void testCheckAnswer() {
        Exercise exercise = new Exercise("What is 2 + 2?", new String[]{"A. 3", "B. 4", "C. 5", "D. 6"}, 1);
        assertTrue(exercise.checkAnswer(2)); // 正确答案
        assertFalse(exercise.checkAnswer(1)); // 错误答案
    }

    @Test
    public void testGetCorrectAnswer() {
        Exercise exercise = new Exercise("What is 2 + 2?", new String[]{"A. 3", "B. 4", "C. 5", "D. 6"}, 1);
        assertEquals(2, exercise.getCorrectAnswer()); // 正确答案应该是B
    }
}